package com.gao.xml.jaxb.adapter;

import javax.xml.bind.annotation.adapters.XmlAdapter;

/**
 * Description:为XML字段添加 CDATA
 *
 * @author: gaoxi
 * @date: 2020/9/23 15:37
 */
public class AdapterCdata extends XmlAdapter<String, String> {

    @Override
    public String marshal(String arg0) throws Exception {
        return "<![CDATA[" + arg0 + "]]>";
    }

    @Override
    public String unmarshal(String arg0) throws Exception {
        return arg0;
    }

}